package dockyin.action.pattern.chainofresponsibility;

public class Handler extends AbstractHandler implements IHandler {

    private String name;

    public Handler(String name)
    {
        this.name = name;
    }

    @Override
    public void operate() {
        System.out.println(name + " has been dealt.");

        // invoke operate method of next handler
        if (null != getHandler())
        {
            getHandler().operate();
        }
    }
}
